package net.googlecode.garzha.task4;

import java.io.*;
/**
 * Created by IntelliJ IDEA.
 * User: Valera
 * Date: 05.04.11
 * Time: 14:24
 */


/**
 * String machine. Modifies strings.
 */
public class StringMachine {

    /**
     * Main menu
     *
     * @param args
     */
    public static void main(String[] args) throws IOException {

        String str = "    eveRYOne   hEArs only what he understands.";
        StringUtility n = new StringUtility();
        Logger log = new Logger();
        log.start();
        System.out.println(str);
        BufferedReader bReader = new

        BufferedReader(new InputStreamReader(System.in));
        String buf = null;


       while (true){
       str = "    eveRYOne   hEArs only what he understands.";
        buf = bReader.readLine();
        if (buf.equals("1"))
        {
            str = n.normalize(str);
            log.printWork(str,"Normalize");
        }
        if (buf.equals("2"))
        {
            str = n.raiseFirstLetters(str);
            log.printWork(str,"Raise first letters all words");
        }
        if (buf.equals("3"))
        {
            str = n.rotateSentence(str);
            log.printWork(str,"Rotate all words in sentence");
        }
        if (buf.equals("4"))
        {
            str = n.replaceAllAtoExclamationMark(str);
            log.printWork(str,"Replace all 'a' and 'A' to exclamation mark");
        }
        if (buf.equals("5"))
        {
            str = n.addToEndDate(str);
            log.printWork(str,"Add to end date");
        }
        if (buf.equals("6")) {
            break;
        }
            }
    }
}
